package ink.xiaobaibai.service;

import com.baomidou.mybatisplus.extension.service.IService;
import ink.xiaobaibai.common.ServiceResult;
import ink.xiaobaibai.entity.Coupon;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author xiaobaibai
 * @since 2021-06-05
 */
public interface ICouponService extends IService<Coupon> {

    /**
     * 查看当前用户可领取的优惠券
     */
    public List<Coupon> getCanReceiveCouponByUserId(Integer userId);

    /**
     * 领取当前优惠券
     */
    public ServiceResult receiveThisCouponById(Integer couponId, Integer userId);

    /**
     * 根据orderId消耗券
     */
    public void consumeCoupon(String orderId, Integer userId);

}
